﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using System.Data.SqlClient;
namespace DAO
{
    public class NhanVienDAO
    {
        NhanVienDTO[] LayDanhSachNhanVien()
        {
            List<NhanVienDTO> res = new List<NhanVienDTO>();
            res.Add(new NhanVienDTO(1, "admin", "admin", "Admin", DateTime.Parse("04/01/2013"), "Nam", "Gia Lai", "090", 1));
            res.Add( new NhanVienDTO(2,"NV001","Le Kim Dung","lekimdung",DateTime.Parse("09/10/1986"), "Nam","Gia Lai","0907600747",1));
            res.Add(new NhanVienDTO(3, "NV002", "Phuong Duyen", "phuongduyen", DateTime.Parse("04/01/2013"), "Nu", "DongNai", "090", 1));
            res.Add(new NhanVienDTO(4, "NV002", "Doan Phong", "doanphong", DateTime.Parse("04/01/2013"), "Nam", "HCM", "090", 1));
            res.Add(new NhanVienDTO(5, "NV003", "Doan Vuong", "doanvuong", DateTime.Parse("04/01/2013"), "Nam", "Quang Ngai", "090", 1));
            return res.ToArray();
        }

        public int KiemTraDangNhap(int manv, string mk)
        {
            int kq=0;
            //SqlConnection conn = new SqlConnection();
            //conn = DataProvider.con();            
            //SqlCommand cmd = new SqlCommand("Select * from NhanVien where ma_nhan_vien= "+manv+" and ten_nhan_vien='"+mk+"' ",conn);
            //kq=cmd.ExecuteNonQuery();
            //conn.Close();
            return kq;            
        }
    }
}
